package models;

import java.util.*;

import javax.persistence.*;

import play.db.ebean.*;
import play.db.ebean.Model.Finder;
import play.data.format.*;
import play.data.validation.*;
import com.avaje.ebean.*;

@Entity
public class Chapitre extends Model {

	@Id
	private Long idChapitre;
	
	@ManyToOne
	private Matiere matiere;
	private List<Question> sesQuestions;
	
	@Constraints.Required
	private String libelleC;

	public static Finder<Long, Chapitre> find = new Finder<Long, Chapitre>(
			Long.class, Chapitre.class);

	/*
	 * GETTER ET SETTER
	 */
	
	@OneToMany(mappedBy = "chapitre")
	public List<Question> getSesQuestions() {
		return sesQuestions;
	}

	public void setSesQuestions(List<Question> t) {
		this.sesQuestions = t;
	}

	public Long getIdChapitre() {
		return idChapitre;
	}

	public void setIdChapitre(Long idChapitre) {
		this.idChapitre = idChapitre;
	}

	public Matiere getMatiere() {
		return matiere;
	}

	public void setMatiere(Matiere matiere) {
		this.matiere = matiere;
	}

	public String getLibelleC() {
		return libelleC;
	}

	public void setLibelleC(String libelleC) {
		this.libelleC = libelleC;
	}

}
